#!/usr/bin/env python
# -*- coding: utf-8 -*-

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

# Generated with glade2py script
# glade2py script can be found at hocr web site http://hocr.berlios.de

import sys
import os
from subprocess import Popen, PIPE
import pygtk
pygtk.require('2.0')

import gtk, gtk.glade
import msg


cmd = os.system

class MainWindow:
    def __init__(self):
        # create widget tree ...
        # create widget tree ...
        file_glade = '/usr/share/zaitan/pixmaps/painel-zaitan.glade'
	#file_glade = '/home/nilton/Projetos/Zaitan/trunk/zaitan_0.8.4/pixmaps/painel-zaitan.glade'
        xml = gtk.glade.XML(file_glade)

        # connect handlers
        xml.signal_autoconnect(self)

        # widgets
        self.zaitan1 = xml.get_widget('zaitan1')
        self.layout1 = xml.get_widget('layout1')
        self.vbox1 = xml.get_widget('vbox1')
        self.layout2 = xml.get_widget('layout2')
        self.image1 = xml.get_widget('image1')
        self.image2 = xml.get_widget('image2')
        self.notebook1 = xml.get_widget('notebook1')
        self.notebook2 = xml.get_widget('notebook2')
        self.fixed1 = xml.get_widget('fixed1')
        self.image3 = xml.get_widget('image3')
        self.label7 = xml.get_widget('label7')
        self.skype = xml.get_widget('skype')
        self.label5 = xml.get_widget('label5')
        self.fixed2 = xml.get_widget('fixed2')
        self.image7 = xml.get_widget('image7')
        self.label26 = xml.get_widget('label26')
        self.amsn = xml.get_widget('amsn')
        self.label9 = xml.get_widget('label9')
        self.fixed3 = xml.get_widget('fixed3')
        self.image5 = xml.get_widget('image5')
        self.emesene = xml.get_widget('emesene')
        self.label23 = xml.get_widget('label23')
        self.label10 = xml.get_widget('label10')
        self.fixed4 = xml.get_widget('fixed4')
        self.image4 = xml.get_widget('image4')
        self.label24 = xml.get_widget('label24')
        self.mercury = xml.get_widget('mercury')
        self.label11 = xml.get_widget('label11')
        self.fixed5 = xml.get_widget('fixed5')
        self.image6 = xml.get_widget('image6')
        self.label25 = xml.get_widget('label25')
        self.jsms = xml.get_widget('jsms')
        self.label12 = xml.get_widget('label12')
        self.fixed6 = xml.get_widget('fixed6')
        self.image8 = xml.get_widget('image8')
        self.label28 = xml.get_widget('label28')
        self.gftp = xml.get_widget('gftp')
        self.label13 = xml.get_widget('label13')
        self.fixed7 = xml.get_widget('fixed7')
        self.image10 = xml.get_widget('image10')
        self.label31 = xml.get_widget('label31')
        self.blogtk = xml.get_widget('blogtk')
        self.label14 = xml.get_widget('label14')
        self.fixed8 = xml.get_widget('fixed8')
        self.image12 = xml.get_widget('image12')
        self.label29 = xml.get_widget('label29')
        self.opera = xml.get_widget('opera')
        self.label15 = xml.get_widget('label15')
        self.fixed9 = xml.get_widget('fixed9')
        self.image9 = xml.get_widget('image9')
        self.label8 = xml.get_widget('label8')
        self.liferea = xml.get_widget('liferea')
        self.label16 = xml.get_widget('label16')
        self.fixed10 = xml.get_widget('fixed10')
        self.label17 = xml.get_widget('label17')
        self.fixed11 = xml.get_widget('fixed11')
        self.label18 = xml.get_widget('label18')
        self.layout9 = xml.get_widget('layout9')
        self.label19 = xml.get_widget('label19')
        self.layout10 = xml.get_widget('layout10')
        self.label6 = xml.get_widget('label6')
        self.label1 = xml.get_widget('label1')
        self.layout3 = xml.get_widget('layout3')
        self.notebook4 = xml.get_widget('notebook4')
        self.fixed23 = xml.get_widget('fixed23')
        self.image15 = xml.get_widget('image15')
        self.label47 = xml.get_widget('label47')
        self.stoq = xml.get_widget('stoq')
        self.label48 = xml.get_widget('label48')
        self.fixed24 = xml.get_widget('fixed24')
        self.image16 = xml.get_widget('image16')
        self.label49 = xml.get_widget('label49')
        self.envy = xml.get_widget('envy')
        self.label50 = xml.get_widget('label50')
        self.fixed25 = xml.get_widget('fixed25')
        self.image17 = xml.get_widget('image17')
        self.emesene2 = xml.get_widget('emesene2')
        self.label51 = xml.get_widget('label51')
        self.label52 = xml.get_widget('label52')
        self.fixed26 = xml.get_widget('fixed26')
        self.image18 = xml.get_widget('image18')
        self.label53 = xml.get_widget('label53')
        self.mercury2 = xml.get_widget('mercury2')
        self.label54 = xml.get_widget('label54')
        self.fixed27 = xml.get_widget('fixed27')
        self.image19 = xml.get_widget('image19')
        self.label55 = xml.get_widget('label55')
        self.jsms2 = xml.get_widget('jsms2')
        self.label56 = xml.get_widget('label56')
        self.fixed28 = xml.get_widget('fixed28')
        self.image20 = xml.get_widget('image20')
        self.label57 = xml.get_widget('label57')
        self.gftp2 = xml.get_widget('gftp2')
        self.label58 = xml.get_widget('label58')
        self.fixed29 = xml.get_widget('fixed29')
        self.label59 = xml.get_widget('label59')
        self.fixed30 = xml.get_widget('fixed30')
        self.label60 = xml.get_widget('label60')
        self.fixed31 = xml.get_widget('fixed31')
        self.label61 = xml.get_widget('label61')
        self.fixed32 = xml.get_widget('fixed32')
        self.label62 = xml.get_widget('label62')
        self.fixed33 = xml.get_widget('fixed33')
        self.label63 = xml.get_widget('label63')
        self.layout13 = xml.get_widget('layout13')
        self.label64 = xml.get_widget('label64')
        self.layout14 = xml.get_widget('layout14')
        self.label65 = xml.get_widget('label65')
        self.label2 = xml.get_widget('label2')
        self.layout4 = xml.get_widget('layout4')
        self.label3 = xml.get_widget('label3')
        self.layout5 = xml.get_widget('layout5')
        self.label4 = xml.get_widget('label4')
        self.layout6 = xml.get_widget('layout6')
        self.label20 = xml.get_widget('label20')
        self.layout7 = xml.get_widget('layout7')
        self.label21 = xml.get_widget('label21')
        self.layout8 = xml.get_widget('layout8')
        self.sauerbraten = xml.get_widget('sauerbraten')
        self.fixed34 = xml.get_widget('fixed34')
        self.image21 = xml.get_widget('image21')
        self.label72 = xml.get_widget('label72')
        self.smc = xml.get_widget('smc')
        self.label73 = xml.get_widget('label73')
        self.fixed35 = xml.get_widget('fixed35')
        self.image22 = xml.get_widget('image22')
        self.smc_1_2 = xml.get_widget('smc_1_2')
        self.label27 = xml.get_widget('label27')
        self.label75 = xml.get_widget('label75')
        self.fixed36 = xml.get_widget('fixed36')
        self.image23 = xml.get_widget('image23')
        self.maniadrive = xml.get_widget('maniadrive')
        self.label76 = xml.get_widget('label76')
        self.label77 = xml.get_widget('label77')
        self.fixed37 = xml.get_widget('fixed37')
        self.image24 = xml.get_widget('image24')
        self.label78 = xml.get_widget('label78')
        self.zsnes = xml.get_widget('zsnes')
        self.label79 = xml.get_widget('label79')
        self.fixed38 = xml.get_widget('fixed38')
        self.image25 = xml.get_widget('image25')
        self.label80 = xml.get_widget('label80')
        self.manaworld = xml.get_widget('manaworld')
        self.label81 = xml.get_widget('label81')
        self.fixed39 = xml.get_widget('fixed39')
        self.image26 = xml.get_widget('image26')
        self.label82 = xml.get_widget('label82')
        self.sauerbraten = xml.get_widget('sauerbraten')
        self.label83 = xml.get_widget('label83')
        self.fixed40 = xml.get_widget('fixed40')
        self.label84 = xml.get_widget('label84')
        self.fixed41 = xml.get_widget('fixed41')
        self.label85 = xml.get_widget('label85')
        self.fixed42 = xml.get_widget('fixed42')
        self.label86 = xml.get_widget('label86')
        self.fixed43 = xml.get_widget('fixed43')
        self.label87 = xml.get_widget('label87')
        self.fixed44 = xml.get_widget('fixed44')
        self.label88 = xml.get_widget('label88')
        self.layout21 = xml.get_widget('layout21')
        self.label89 = xml.get_widget('label89')
        self.layout22 = xml.get_widget('layout22')
        self.label90 = xml.get_widget('label90')
        self.label22 = xml.get_widget('label22')
        self.menubar1 = xml.get_widget('menubar1')
        self.menuitem1 = xml.get_widget('menuitem1')
        self.menu1 = xml.get_widget('menu1')
        self.botao_sair = xml.get_widget('botao_sair')
        self.menuitem4 = xml.get_widget('menuitem4')
        self.menu3 = xml.get_widget('menu3')
        self.aboutmenu = xml.get_widget('aboutmenu')
        self.TerminalWindow3 = xml.get_widget('TerminalWindow3')
        self.vbox16 = xml.get_widget('vbox16')
        self.label6 = xml.get_widget('label6')
        self.scrolledwindow4 = xml.get_widget('scrolledwindow4')
        self.hbuttonbox14 = xml.get_widget('hbuttonbox14')
        self.termbutton4 = xml.get_widget('termbutton4')



 # signal handlers
## Aba Internet e Mensagens
    def on_skype_clicked(self, obj, event = None):
        "on_skype_clicked activated"
        cmd("xterm -e /usr/lib/zaitan/modulo/mod-skype")

    def on_amsn_clicked(self, obj, event = None):
        "on_amsn_clicked activated"
        cmd("xterm -e /usr/lib/zaitan/modulo/mod-amsn")

    def on_emesene_clicked(self, obj, event = None):
        "on_emesene_clicked activated"
        cmd("xterm -e /usr/lib/zaitan/modulo/mod-emesene")

    def on_mercury_clicked(self, obj, event = None):
        "on_mercury_clicked activated"
        cmd("xterm -e /usr/lib/zaitan/modulo/mod-mercury")

    def on_jsms_clicked(self, obj, event = None):
        "on_jsms_clicked activated"
        cmd("xterm -e /usr/lib/zaitan/modulo/mod-jsms")

    def on_gftp_clicked(self, obj, event = None):
        "on_gftp_clicked activated"
        cmd("xterm -e /usr/lib/zaitan/modulo/mod-multi gftp")

    def on_blogtk_clicked(self, obj, event = None):
        "on_blogtk_clicked activated"
        cmd("xterm -e /usr/lib/zaitan/modulo/mod-multi blogtk")

    def on_opera_clicked(self, obj, event = None):
        "on_opera_clicked activated"
        cmd("xterm -e /usr/lib/zaitan/modulo/mod-opera")

    def on_liferea_clicked(self, obj, event = None):
        "on_liferea_clicked activated"
        cmd("xterm -e /usr/lib/zaitan/modulo/mod-multi liferea")


## Aba Variados
    def on_stoq_clicked(self, obj, event = None):
        "on_stoq_clicked activated"
        cmd("xterm -e /usr/lib/zaitan/modulo/mod-stoq")

    def on_envy_clicked(self, obj, event = None):
        "on_envy_clicked activated"
        cmd("xterm -e /usr/lib/zaitan/modulo/mod-envy")
        

## Aba Games
    def on_maniadrive_clicked(self, obj, event = None):
        "on_maniadrive_clicked activated"
        cmd("xterm -e /usr/lib/zaitan/modulo/mod-maniadrive")

    def on_zsnes_clicked(self, obj, event = None):
        "on_zsnes_clicked activated"
        cmd("xterm -e /usr/lib/zaitan/modulo/mod-zsnes")

    def on_manaworld_clicked(self, obj, event = None):
        "on_manaworld_clicked activated"
        cmd("xterm -e /usr/lib/zaitan/modulo/mod-manaworld")

    def on_sauerbraten_clicked(self, obj, event = None):
        "on_sauerbraten_clicked activated"
        cmd("xterm -e /usr/lib/zaitan/modulo/mod-sauerbraten")

    def on_smc_clicked(self, obj, event = None):
        "on_smc_clicked activated"
        cmd("xterm -e /usr/lib/zaitan/modulo/mod-smc")

    def on_smc_1_2_clicked(self, obj, event = None):
        "on_smc_1_2_clicked activated"
        cmd("xterm -e /usr/lib/zaitan/modulo/mod-smc.1.2")


    def botao_sair_activate_cb(self, obj, event = None):
        "botao_sair_activate_cb activated"
        gtk.main_quit()

    def zaitan1_delete_event_cb(self, widget, obj):
        "zaitan1_delete_event_cb activated"
        gtk.main_quit()

    def aboutmenu_activate_cb(self, obj, event = None):
        "aboutmenu_activate_cb activated"
        print 'aboutmenu_activate_cb activated'


# run main loop
def main():
    main_window = MainWindow()
    main_window.zaitan1.show()
    gtk.main()
    import notificator
    notificator.new_zaitan()

if __name__ == "__main__":
    main()
